
from elixir import *
import elixir as el

class NSIsymptoms(Entity):
        id = Field(Integer, primary_key = True)
        event_id = Field(Integer)
        feeling_dizzy = Field(Integer)
        loss_balance = Field(Integer)
        poor_coordination = Field(Integer)
        headaches = Field(Integer)
        nausea = Field(Integer)
        vision_problems = Field(Integer)
        light_sensitivity = Field(Integer)
        hearing_difficulty = Field(Integer)
        noise_sensitivity = Field(Integer)
        numbness = Field(Integer)
        taste_changes = Field(Integer)
        appetite = Field(Integer)
        concentration = Field(Integer)
        forgetfulness = Field(Integer)
        decision_difficulty = Field(Integer)
        thinking = Field(Integer)
        fatigue = Field(Integer)
        sleep = Field(Integer)
        anxiety = Field(Integer)
        depressed = Field(Integer)
        irritability = Field(Integer)
        frustration = Field(Integer)


        def __repr__(self):
                return '<NSI "event_id: %d">' %(self.event_id)

class Level2DbLoader():
    def __init__ (self):
        el.metadata.bind = 'sqlite:///Polytrauma_Tracking.sqlite3'
        el.metadata.bind.echo = True

        el.setup_all()
        el.create_all()

    def load_database(self, data):
        nsi = NSIsymptoms()
        nsi.from_dict(data)
        session.commit()

  